using Lzfy_Refund_Service.Models;

namespace Lzfy_Refund_Service.Repositories
{
    public interface IUserRepository
    {
        // 原有方法
        Task<User?> GetByUsernameAsync(string username);
        Task<User?> GetByIdAsync(int id);
        Task<IEnumerable<User>> GetAllAsync();
        Task<int> CreateAsync(User user);
        Task<bool> UpdateAsync(User user);
        Task<bool> DeleteAsync(int id);
        Task<bool> UpdateLastLoginAsync(int userId);
        
        // 新增权限管理方法
        Task<UserListResponse> GetUserListAsync(UserListRequest request);
        Task<User?> GetUserByIdAsync(int id);
        Task<User?> GetUserByUsernameAsync(string username);
        Task<int> AddUserAsync(User user);
        Task<bool> UpdateUserAsync(User user);
        Task<bool> DeleteUserAsync(int id);
        Task<bool> ToggleUserStatusAsync(int id, bool isActive);
        Task<bool> ResetPasswordAsync(int id, string newPassword);
        Task<bool> UsernameExistsAsync(string username, int? excludeId = null);
        Task<List<UserRoleDto>> GetUserRolesAsync(int userId);
        Task<bool> AssignUserRolesAsync(int userId, List<int> roleIds);
        Task<bool> RemoveUserRolesAsync(int userId);
    }
}